645d874eda971f79a0927aa6370adb9489f148b7,server/sonar-server/src/test/java/org/sonar/server/component/ComponentServiceTest.java,ComponentServiceTest,fail_to_create_new_component_on_invalid_branch,#,362

Before Change


  public void fail_to_create_new_component_on_invalid_branch() {
    userSessionRule.login("john").setGlobalPermissions(PROVISIONING);

    try {
      service.create(NewComponent.create("struts", "Struts project").setBranch("origin?branch"));
      fail();
    } catch (Exception e) {
      assertThat(e).isInstanceOf(BadRequestException.class).hasMessage(
        "Malformed branch for Project: origin?branch. Allowed characters are alphanumeric, '-', '_', '.' and '/', with at least one non-digit.");
    }
  }

After Change



  @Test
  public void fail_to_create_new_component_on_invalid_branch() {
    expectedException.expect(BadRequestException.class);
    expectedException.expectMessage("Malformed branch for Project: origin?branch. Allowed characters are alphanumeric, '-', '_', '.' and '/', with at least one non-digit.");

    userSession.login("john").setGlobalPermissions(PROVISIONING);

    underTest.create(NewComponent.create("struts", "Struts project").setBranch("origin?branch"));
  }

  @Test